import 'dart:async';

import 'package:hc_connectivity/wifi_network.dart';

import 'hc_method_channel_connectivity.dart';
import 'hc_plugin_platform_interface.dart';

abstract class HcConnectivityPlatform extends PlatformInterface {
  /// Constructs a ConnectivityPlatform.
  HcConnectivityPlatform() : super(token: _token);

  static final Object _token = Object();

  static HcConnectivityPlatform _instance = MethodChannelConnectivity();

  /// The default instance of [ConnectivityPlatform] to use.
  ///
  /// Defaults to [MethodChannelConnectivity].
  static HcConnectivityPlatform get instance => _instance;

  /// Platform-specific plugins should set this with their own platform-specific
  /// class that extends [ConnectivityPlatform] when they register themselves.
  static set instance(HcConnectivityPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  /// Checks the connection status of the device.
  Future<List<WifiNetwork>> checkConnectivity() {
    throw UnimplementedError('checkConnectivity() has not been implemented.');
  }

  /// Returns a Stream of ConnectivityResults changes.
  Stream<List<WifiNetwork>> get onConnectivityChanged {
    throw UnimplementedError(
        'get onConnectivityChanged has not been implemented.');
  }

  /// Obtains the wifi name (SSID) of the connected network
  Future<String?> getWifiName() {
    throw UnimplementedError('getWifiName() has not been implemented.');
  }

  /// Obtains the wifi BSSID of the connected network.
  Future<String?> getWifiBSSID() {
    throw UnimplementedError('getWifiBSSID() has not been implemented.');
  }

  /// Obtains the IP address of the connected wifi network
  Future<String?> getWifiIP() {
    throw UnimplementedError('getWifiIP() has not been implemented.');
  }

  Future<bool> isEnabled() {
    throw UnimplementedError('isEnabled() has not been implemented.');
  }

  void setEnabled(bool state) {
    throw UnimplementedError('setEnabled() has not been implemented.');
  }

  Future<bool> isConnected() {
    throw UnimplementedError('isConnected() has not been implemented.');
  }

  Future<bool> disconnect() {
    throw UnimplementedError('disconnect() has not been implemented.');
  }

  Future<bool> connect(String ssid,
      {String? password,
      NetworkSecurity security = NetworkSecurity.NONE,
      bool joinOnce = true,
      bool withInternet = false}) {
    throw UnimplementedError('connect() has not been implemented.');
  }

  Future<bool> forceWifiUsage(bool useWifi) {
    throw UnimplementedError('forceWifiUsage() has not been implemented.');
  }

  Future<bool> registerWifiNetwork(String ssid,
      {String? password, NetworkSecurity security = NetworkSecurity.NONE}) {
    throw UnimplementedError('registerWifiNetwork() has not been implemented.');
  }

  Future<bool> removeWifiNetwork(String ssid) {
    throw UnimplementedError('removeWifiNetwork() has not been implemented.');
  }

  Future<String?> openWifiNetwork() {
    throw UnimplementedError('openWifiNetwork() has not been implemented.');
  }
}
